package com.googlecode.garbagecan.cxfstudy.jaxws;

import java.net.URL;

import javax.xml.namespace.QName;
import javax.xml.ws.Service;

// 1. Start MyServer in IDE.
// 2. Run this command in command line:
//    java -cp classes com.googlecode.garbagecan.cxfstudy.jaxws.SimpleClient
public class SimpleClient {
	public static void main(String[] args) throws Exception {
		long start = System.currentTimeMillis();
		URL url = new URL("http://localhost:9000/ws/jaxws/customerService?wsdl");
		QName qname = new QName("http://jaxws.cxfstudy.garbagecan.googlecode.com/", CustomerServiceImpl.class.getSimpleName() + "Service");
		Service service = Service.create(url, qname);
		CustomerService customerService = service.getPort(CustomerService.class);
		System.out.println(customerService.findCustomer("kongxx"));
		long stop = System.currentTimeMillis();
		System.out.println(stop - start);
	}
}
